.\" Copyright (c) 2018, Martin Kepplinger <martink@posteo.de>
.\"
.\" %%%LICENSE_START(GPLv2+_DOC_FULL)
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.\"
.TH TS_CONF_GET 3  "" "" "tslib"
.SH NAME
ts_conf_set \- write a new TSLIB_CONFFILE config file and reload it.
.SH SYNOPSIS
.nf
.B #include <tslib.h>
.sp
.BI "int ts_conf_set(struct ts_module_conf *conf);"
.sp
.fi

.SH DESCRIPTION
.BR ts_conf_set ()
This function takes a pointer to a struct ts_module_conf. It reads data from
all linked structs in the list (next and prev pointers) and writes a new
TSLIB_CONFFILE. The first struct in the list (where prev is NULL) is
the first line and so on. After writing, ts_reconfig() has to be called so the
new modules and parameters are reloaded and applied to the currently
running program.

The given set of ts_module_conf structs is freed and destroyed here.
After calling ts_conf_set() one has to use ts_conf_get() again, for a
different change.

.nf
struct ts_module_conf {
	char *name;
	char *params;
	int raw;
	int nr;

	struct ts_module_conf *next;
	struct ts_module_conf *prev;
};
.fi

.RE
.SH RETURN VALUE
This function returns zero on success and a negative integer on failure.

.SH SEE ALSO
.BR ts_conf_get (3),
.BR ts_config (3),
.BR ts.conf (5)
